import Vue from "vue";
import VueRouter from "vue-router";

import Lianxi1 from "@/views/Lianxi/Lianxi1";
import yemian from "@/views/yemian/Yemian";
import homepage from "@/views/HomePage/homepage";
Vue.use(VueRouter);
// 公共路由
export const constantRoutes = [
    {//练习
        path: "/Lianxi1",
        name: 'Lianxi1',
        component: Lianxi1,
    },
    {
        path: "/yemian",
        name: yemian,
        component: yemian,
        //子路由
        children: [
            {
                path: "homepage",    // 相对路径 首页

                component: () => import('@/views/HomePage/homepage')
            },
            {
                path: "user",    // 相对路径 用户

                component: () => import('@/views/User/user')
            },
            {
                path: "role",    // 相对路径 角色

                component: () => import('@/views/Role/role')
            },
            {
                path: "menu",    // 相对路径 菜单

                component: () => import('@/views/Menu/menu')
            },
            {
                path: "dictionaries",    // 相对路径 字典

                component: () => import('@/views/Dictionaries/dictionaries')
            },

        ],
    },
]
const router =  new VueRouter({
    mode: "history", // 后台服务器也要做相关配置 https://v3.router.vuejs.org/zh/guide/essentials/history-mode.html#%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E4%BE%8B%E5%AD%90
    routes: constantRoutes,
  });
export default router;
